export default {
  mode: "universal",
  /*
   ** Headers of the page
   */

  server: {
    port: "8001", // default: 3002
    host: "127.0.0.1" // default: localhost
  },
  // other configs,其他的配置,没有做任何的变化

  head: {
    title: process.env.npm_package_name || "",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      {
        hid: "description",
        name: "description",
        content: process.env.npm_package_description || ""
      }
    ],
    link: [
      {
        rel: "shortcut icon",
        sizes: "180x180",
        type: "image/png",
        href: "/assets/images/favicon.png"
      },
      {
        rel: "stylesheet",
        href:
          "https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&display=swap"
      },
      { rel: "stylesheet", href: "/assets/css/bootstrap.min.css" },
      { rel: "stylesheet", href: "/assets/css/animate.min.css" },
      { rel: "stylesheet", href: "/assets/css/font-awesome.min.css" },
      {
        rel: "stylesheet",
        href: "/assets/plugins/glightbox/glightbox.min.css"
      },
      { rel: "stylesheet", href: "/assets/css/fontawesome-all.min.css" },
      { rel: "stylesheet", href: "/assets/css/flaticon.css" },
      { rel: "stylesheet", href: "/assets/css/default.css" },
      { rel: "stylesheet", href: "/assets/css/style.css" }
    ],

    script: [
      { src: "/assets/plugins/glightbox/glightbox.min.js", body: true },
      { src: "/assets/plugins/accordion/accordion.min.js", body: true }
    ]
  },
  /*
   ** Customize the progress-bar color
   */
  loading: { color: "$theme-color", height: "4px" },
  /*
   ** Global CSS
   */
  /*
   ** Plugins to load before mounting the App
   */
  plugins: [
    { src: "plugins/owl.js", ssr: false },
    "~/plugins/element-ui/element-ui.js" //引入element-ui依賴
  ],
  css: ["element-ui/lib/theme-chalk/index.css"], //樣式
  /*
   ** Nuxt.js dev-modules
   */
  buildModules: [],
  /*
   ** Nuxt.js modules
   */
  modules: ["@nuxtjs/style-resources"],
  /*
   ** Build configuration
   */
  build: {
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {
      config.module.rules.push({
        test: /\.pdf$/,
        use: {
          loader: "pdf-loader",
          options: {
            /* loader options */
          }
        }
      });
    },
    vendor: ["element-ui"] //防止多次被打包
  },
  proxy: {
    "/api": {
      target: "http://127.0.0.1:8000",
      changeOrigin: true,
      pathRewrith: {
        "^/api": "/"
      }
    }
  }
};
